update twilio agent spec to ensure proper twilio rest api calls are made

Albert Sun 9 years ago
parent
commit
11363b4b03
1 changed files with 2 additions and 3 deletions
  1. 2 3
      spec/models/agents/twilio_agent_spec.rb

+ 2 - 3
spec/models/agents/twilio_agent_spec.rb

@@ -20,8 +20,8 @@ describe Agents::TwilioAgent do
20 20
     @event.save!
21 21
 
22 22
     @sent_messages = []
23
-    stub.any_instance_of(Agents::TwilioAgent).send_message { |message| @sent_messages << message}
24
-    stub.any_instance_of(Agents::TwilioAgent).make_call {}
23
+    stub.any_instance_of(Twilio::REST::Messages).create { |message| @sent_messages << message[:body]}
24
+    stub.any_instance_of(Twilio::REST::Calls).create
25 25
   end
26 26
 
27 27
   describe '#receive' do
@@ -51,7 +51,6 @@ describe Agents::TwilioAgent do
51 51
       @checker.receive([@event])
52 52
       expect(@checker.memory[:pending_calls]).not_to eq({})
53 53
     end
54
-
55 54
   end
56 55
 
57 56
   describe '#working?' do